package com.ruoyi.system.service.impl;

import java.util.List;

import com.ruoyi.common.core.domain.entity.SysRole;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.SysIdentityTypeMapper;
import com.ruoyi.system.domain.SysIdentityType;
import com.ruoyi.system.service.ISysIdentityTypeService;

/**
 * 证件类型Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-07-30
 */
@Service
public class SysIdentityTypeServiceImpl implements ISysIdentityTypeService 
{
    @Autowired
    private SysIdentityTypeMapper sysIdentityTypeMapper;

    /**
     * 查询证件类型
     * 
     * @param id 证件类型主键
     * @return 证件类型
     */
    @Override
    public SysIdentityType selectSysIdentityTypeById(Integer id)
    {
        return sysIdentityTypeMapper.selectSysIdentityTypeById(id);
    }

    /**
     * 查询证件类型列表
     * 
     * @param sysIdentityType 证件类型
     * @return 证件类型
     */
    @Override
    public List<SysIdentityType> selectSysIdentityTypeList(SysIdentityType sysIdentityType)
    {
        return sysIdentityTypeMapper.selectSysIdentityTypeList(sysIdentityType);
    }

    /**
     * 新增证件类型
     * 
     * @param sysIdentityType 证件类型
     * @return 结果
     */
    @Override
    public int insertSysIdentityType(SysIdentityType sysIdentityType)
    {
        sysIdentityType.setCreateTime(DateUtils.getNowDate());
        return sysIdentityTypeMapper.insertSysIdentityType(sysIdentityType);
    }

    /**
     * 修改证件类型
     * 
     * @param sysIdentityType 证件类型
     * @return 结果
     */
    @Override
    public int updateSysIdentityType(SysIdentityType sysIdentityType)
    {
        return sysIdentityTypeMapper.updateSysIdentityType(sysIdentityType);
    }

    /**
     * 批量删除证件类型
     * 
     * @param ids 需要删除的证件类型主键
     * @return 结果
     */
    @Override
    public int deleteSysIdentityTypeByIds(Integer[] ids)
    {
        return sysIdentityTypeMapper.deleteSysIdentityTypeByIds(ids);
    }

    /**
     * 删除证件类型信息
     * 
     * @param id 证件类型主键
     * @return 结果
     */
    @Override
    public int deleteSysIdentityTypeById(Integer id)
    {
        return sysIdentityTypeMapper.deleteSysIdentityTypeById(id);
    }

    /**
     * 修改证件类型状态
     *
     * @param sysIdentityType 角色信息
     * @return 结果
     */
    @Override
    public int updateSysIdentityTypeStatus(SysIdentityType sysIdentityType)
    {
        return sysIdentityTypeMapper.updateSysIdentityType(sysIdentityType);
    }
}
